﻿--HEADER Create InvestmentBenchmarkUnderlyingSerie and InvestmentSecurityUnderlyingSerie

CREATE TABLE [Analytics].[InvestmentBenchmarkUnderlyingSerie](
	[InvestmentId] [int] NOT NULL,
	[UnderlyingSecurityId] [int] NOT NULL,
	[BenchmarkId] [int] NOT NULL,
	[Date] [date] NOT NULL,
	[StockReturn] [decimal](18, 4) NULL,
	CONSTRAINT PK_InvestmentBenchmarkUnderlyingSerie  PRIMARY KEY CLUSTERED ([InvestmentId], [UnderlyingSecurityId], [BenchmarkId], [Date])
)

GO

CREATE TABLE [Analytics].[InvestmentSecurityUnderlyingSerie](
	[InvestmentId] [int] NOT NULL,
	[UnderlyingSecurityId] [int] NOT NULL,
	[BenchmarkId] [int] NOT NULL,
	[Date] [date] NOT NULL,
	[StockReturn] [decimal](18, 4) NULL,
	[NormalizationCoeficient] [decimal](18, 4) NULL,
	CONSTRAINT PK_InvestmentSecurityUnderlyingSerie  PRIMARY KEY CLUSTERED ([InvestmentId], [UnderlyingSecurityId], [BenchmarkId], [Date])
)